package com.ldatum.crm.serviceImpl;

import java.sql.SQLException;
import java.util.List;

import com.ldatum.crm.dao.UserDao;
import com.ldatum.crm.daoImpl.UserDaoImpl;
import com.ldatum.crm.domain.User;
import com.ldatum.crm.service.UserService;

public class UserServiceImpl implements UserService {

	private UserDao userDao = new UserDaoImpl();
	
	@Override
	public User query(String username) throws Exception {
		User user = userDao.query(username);
		return user;
	}

	@Override
	public int save(User user) throws Exception {
		return userDao.save(user);
	}

	@Override
	public boolean validationLoginname(String loginname) throws SQLException {
		return userDao.validationLoginname(loginname);
	}

	@Override
	public int update(User u) throws SQLException {
		return userDao.update(u);
	}

	@Override
	public List<User> list() throws SQLException {
		return userDao.list();
	}

	@Override
	public int updateStatusToStart(String ids) throws SQLException {
		return userDao.updateStatusToStart(ids);
	}

	@Override
	public int updateStatusToStoping(String ids) throws SQLException {
		return userDao.updateStatusToStoping(ids);
	}

	@Override
	public User findById(int id) throws SQLException {
		return userDao.findById(id);
	}

	@Override
	public int deletes(String ids) throws SQLException {
		return userDao.deletes(ids);
	}

	@Override
	public boolean validationPwd(int id, String opwd) throws SQLException {
		return userDao.validationPwd(id,opwd);
	}

	@Override
	public int updatePwd(int id, String npwd) throws SQLException {
			return userDao.updatePwd(id,npwd);
	}	

}
